package com.ruoyi.web.controller.modules.yami.shop;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.yami.shop.domain.param.UserRegisterParam;
import com.yami.shop.service.IUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
@Tag(name = "用户注册相关接口")
public class UserRegisterController extends BaseController {

    @Autowired
    private IUserService userService;

    @PostMapping("/register")
    @Operation(summary = "注册" , description = "用户注册或绑定手机号接口")
    public AjaxResult register(@Validated @RequestBody UserRegisterParam userRegisterParam) {
        return toAjax(userService.register(userRegisterParam));
    }
}
